<!--********************************************************************
* Copyright© 2000 - 2025 SuperMap Software Co.Ltd. All rights reserved.
*********************************************************************-->
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title data-i18n="resources.title_googlelayer"></title>
</head>
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
<div id="map" style="margin:0 auto;width: 100%;height: 100%"></div>

<script type="text/javascript" include="bootstrap,widgets.alert" src="../js/include-web.js"></script>
<script type="text/javascript" exclude="iclient-classic" src="../../dist/classic/include-classic.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&key=AIzaSyAG6HlbAVq7CDjZAH3dm5K65EcJy_Z2xWc&"></script>
<script type="text/javascript">
    var map, gooLayer, vector, dataAdded = false;
    map = new SuperMap.Map("map", {
        controls: [
            new SuperMap.Control.Navigation(),
            new SuperMap.Control.Zoom(),
            new SuperMap.Control.LayerSwitcher(),
            new SuperMap.Control.MousePosition()
        ]
    });
    gooLayer = new SuperMap.Layer.Google();
    vector = new SuperMap.Layer.Vector("vector");
    map.addLayers([gooLayer, vector]);
    addData();
    map.setCenter(new SuperMap.LonLat(0, 0), 3);

    function addData() {
        if (!dataAdded) {
            vector.removeAllFeatures();
            //点对象
            var point = new SuperMap.Geometry.Point(0, 0);
            var pointVector = new SuperMap.Feature.Vector(point);
            pointVector.style = {
                fillColor: "red",
                strokeColor: "yellow",
                pointRadius: 10
            };

            vector.addFeatures([pointVector]);
            dataAdded = true;
        } else {
            widgets.alert.showAlert(resources.msg_loadedData, true);
        }
    }

</script>
</body>
</html>